function getURL(){
    if(typeof(document.documentURI) ==  undefined) {
        console.log("documentURL:"+document.documentURI);
        var tail = document.documentURI.substring(7);
        var server = tail.substring(0, tail.indexOf("/"));
        return server;
    }else {
        console.log("windowURL:"+window.location.href);
        var tail = window.location.href.substring(7);
        var server = tail.substring(0,tail.indexOf("/"));
        return server;
    }
}

function showTime(unix_time) {
    var date = new Date(unix_time * 1000);
    var year = date.getFullYear().toString();
    var month = (date.getMonth() + 1).toString();
    if(month.length < 2) month = '0' + month;
    var day = date.getDate().toString();
    if(day.length < 2) day = '0' + day;
    var h = date.getHours().toString();
    if(h.length < 2) h = '0'+ h;
    var m = date.getMinutes().toString();
    if(m.length < 2) m = '0'+ m;
    var s = date.getSeconds().toString();
    if(s.length < 2) s = '0'+ s;
    return year + '-' + month + '-' + day + ' ' + h + ":" + m +":" + s;
}

